import { PageContainer } from '@ant-design/pro-components';
import { Access, useAccess, useModel } from '@umijs/max';
import { Button } from 'antd';
import { useEffect, useRef, useState } from 'react';

import {
  sampleSize, //获得随机数
  uniq, //去重
  sortedUniq,//去重并排序
  take, //从0开始获得指定数组
  takeRight,
  max,
  min,
  lastIndexOf,
  orderBy,//排序
  slice//裁剪数组
} from "lodash"


const AccessPage: React.FC = () => {

  let {
    allRedBallList,
    allRedBallStrList,
    historyList,
    historyResultStrList,
    historyOddEvenList,
    historyOddEvetTongj
  } = useModel("ballModel")
  
  let {
    sortListObj//奇偶组合距离上次出现的期数距离作为key，出现多少次作为值
  } = historyOddEvetTongj;
  
  debugger;

  
  return (
    <PageContainer
      ghost
      header={{
        title: '权限示例',
      }}
    >
      <div className=' overflow-hidden'>
        <table className=' float-left borderTable mr-4'>
          <thead>
            <tr>
              <td>间隔期数</td>
              <td>出现次数</td>
            </tr>
          </thead>
          <tbody>
            {
              Object.keys(sortListObj).map((jiangeCount, index)=>{
                debugger
                let cishu = sortListObj[jiangeCount];
                if(cishu < 20){//出现次数小于10次不展示
                  return null;
                }
                return <tr key={index}>
                  <td>{jiangeCount}</td>
                  <td>{cishu}次</td>
                </tr>
              })
            }
          </tbody>
        </table>

      </div>

    </PageContainer>
  );
};

export default AccessPage;
